﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SanTongSGL.aspx.cs" Inherits="Web.Pages.YongShui.SanTongSGL.SanTongSGL" Theme="Default" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="../../../../JS/AddEditCancel.js"></script>
    <script type="text/javascript">
        //计算值
        function recountValue()
        {
            if (txtSHEJISL.GetText()!=""&&txtPingGuSL.GetText()!="")
            {
                $("#txtChaZhi_I").val(Number(txtSHEJISL.GetText()) - Number(txtPingGuSL.GetText()));
            }
        }
        function validateValue()
        {
            if (txtYonghuh.GetText()=="")
            {
                alert("请输入用户号。");
                return false;
            }
            if (txtPINGGUDW.GetText() == "") {
                alert("请输入评估单位。");
                return false;
            }
            if (txtSHEJISL.GetText() == "") {
                alert("请输入设计水量。");
                return false;
            }
            if (txtPingGuSL.GetText() == "") {
                alert("请输入评估水量。");
                return false;
            }
            if (txtRQ.GetText() == "") {
                alert("请输入日期。");
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="tabletitle1" align="center">
            三同时管理
        </div>
        <asp:UpdatePanel ID="updatePanel1" runat="server">
            <ContentTemplate>
                <div class="top" style="width: 100%; margin: auto;">
                    <fieldset style="border: 1px solid  cornflowerblue; width: 97%; margin: auto;">
                        <legend style="font-weight: bold">查询条件</legend>
                        <table>
                            <tr>
                                <td>用户号：</td>
                                <td>
                                    <dx:ASPxTextBox ID="contxtYongHuH" ClientInstanceName="contxtYongHuH" runat="server" Width="80px">
                                       
                                    </dx:ASPxTextBox>
                                </td>
                                <td>用户名：</td>
                                <td>
                                    <dx:ASPxTextBox ID="contxtYongHuM" ClientInstanceName="contxtYongHuM" runat="server" Width="160px">
                                       
                                    </dx:ASPxTextBox>
                                </td>
                                <td>地址：</td>
                                <td>
                                    <td>

                                        <dx:ASPxTextBox ID="contxtDiZhi" ClientInstanceName="conDiZhi" runat="server" Width="160px">
                                         
                                        </dx:ASPxTextBox>
                                    </td>
                                </td>
                                <td>
                                   <dx:ASPxLoadingPanel ID="LoadPanel" ClientInstanceName="LoadPanel" runat="server" Text="正在查询..."></dx:ASPxLoadingPanel>
                                                <dx:ASPxButton ID="btnSearch" runat="server" Text="查询" UseSubmitBehavior="false" OnClick="btnSearch_Click">
                                                    <ClientSideEvents Click="function(s, e) {  
                                                                        LoadPanel.Show();  
                                                                }" />  
                                                </dx:ASPxButton>
                                </td>
                            </tr>
                        </table>

                    </fieldset>
                </div>

                <div style="height: 3px"></div>

                <fieldset style="border: 1px solid  cornflowerblue; width: 97%; margin: auto;">
                    <legend style="font-weight: bold">查询结果</legend>
                    <dx:ASPxGridView ID="gvSANTONGSHI" runat="server" AutoGenerateColumns="False" KeyFieldName="ID" Theme="Aqua1" Width="100%">
                        <Columns>
                            <dx:GridViewDataTextColumn FieldName="NO" Caption="序号" Width="40px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="S_YONGHUH" Caption="用户号" Width="70px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="S_YONGHUM" Caption="用户名" Width="200px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="S_DIZHI" Caption="地址" Width="250px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="S_PINGGUDW" Caption="评估单位" Width="200px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="I_SHEJISL" Caption="设计水量（m³/d）" Width="120px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="I_PINGGUSL" Caption="评估水量（m³/d）" Width="120px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="I_CHAZHI" Caption="差值（m³/d）" Width="120px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="I_ZHONGSHUI" Caption="中水" Width="120px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="I_YUSHUI" Caption="雨水" Width="120px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="I_PILOUJG" Caption="纰漏监管" Width="120px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="D_RIQI" Caption="日期" Width="130px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Width="35px">
                                    <DataItemTemplate>
                                        <asp:LinkButton ID="lnbModify" runat="server" CausesValidation="false" Text="修改"
                                            CommandArgument='<%#Eval("ID")%>' OnCommand="lnbModify_Command"></asp:LinkButton>
                                    </DataItemTemplate>
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Width="35px">
                                    <DataItemTemplate>
                                        <asp:LinkButton 
                                            ID="lnbDel" runat="server" CausesValidation="false" Text="删除" OnClientClick="return confirm('你确定要删除吗？')"
                                             CommandArgument='<%#Eval("ID")%>' OnCommand="lnbDel_Command"></asp:LinkButton>
                                    </DataItemTemplate>
                            </dx:GridViewDataTextColumn>
                        </Columns>
                        <Settings VerticalScrollableHeight="140" VerticalScrollBarMode="Auto" HorizontalScrollBarMode="Auto" />
                    </dx:ASPxGridView>

                </fieldset>

                <div style="text-align: right">
                    <hr />
                    <dx:ASPxButton ID="btnAdd" runat="server" Text="添加"  OnClick="btnAdd_Click" UseSubmitBehavior="false">
                      
                    </dx:ASPxButton>
                </div>
                <div style="height: 1px;"></div>
                <div id="GridViewContentTable" runat="server" >
                    <div class="tabletitle1" align="center">
                        <asp:Label runat="server" ID="lblOperateTip">添加</asp:Label>
                    </div>
                    <table style="width: 80%;margin:auto;">
                        <tr>
                            <td align="right">用户号：
                            </td>
                            <td>
                                <dx:ASPxTextBox ID="txtYonghuh" ClientInstanceName="txtYonghuh" runat="server" Width="100px">
                                     <ClientSideEvents KeyPress="function(s,e){var key = event.keyCode;
                                                                if( key==13){$('#txtuserNoButton').click();}}" />
                                </dx:ASPxTextBox>
                                 <div style="display: none">
                                                            <dx:ASPxButton ID="txtuserNoButton" runat="server" Text="ASPxButton" OnClick="txtuserNoButton_Click"></dx:ASPxButton>
                                                        </div>
                            </td>
                            <td colspan="7"></td>
                        </tr>
                        <tr>
                            <td align="right">用户名：
                            </td>
                            <td colspan="8">
                                <dx:ASPxTextBox ID="txtYonghum" ClientInstanceName="txtYonghum" runat="server" Width="98.5%" Enabled="false"></dx:ASPxTextBox>
                            </td>
                            </tr>
                        <tr>
                            <td align="right">地址：
                            </td>
                            <td colspan="8">
                                <dx:ASPxTextBox ID="txtDiZhi" ClientInstanceName="txtDiZhi" runat="server" Width="98%" Enabled="false"></dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">评估单位：
                            </td>
                            <td colspan="8">
                                <dx:ASPxTextBox ID="txtPINGGUDW" ClientInstanceName="txtPINGGUDW" runat="server" Width="98%"></dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="width: 10%">设计水量：
                            </td>
                            <td>
                                <dx:ASPxTextBox ID="txtSHEJISL" ClientInstanceName="txtSHEJISL" runat="server" Style="width: 100%;" HorizontalAlign="Right">
                                    <ClientSideEvents KeyUp="function(s,e){inputNum(s);}" LostFocus="function(s,e){recountValue();}" />
                                </dx:ASPxTextBox>
                            </td>
                            <td style="width:5%">（m³/d）</td>
                            <td align="right" style="width: 10%">评估水量：
                            </td>
                            <td>
                                <dx:ASPxTextBox runat="server" ID="txtPingGuSL" ClientInstanceName="txtPingGuSL" type="text" Style="width: 100%;" HorizontalAlign="Right">
                                    <ClientSideEvents KeyUp="function(s,e){inputNum(s);}" LostFocus="function(s,e){recountValue();}" />
                                </dx:ASPxTextBox>
                            </td>
                            <td>（m³/d）</td>
                            <td align="right" style="width: 10%">差值：
                            </td>
                            <td>
                                <dx:ASPxTextBox runat="server" ID="txtChaZhi" ClientInstanceName="txtChaZhi" type="text" Enabled="false" Style="width: 100%;" HorizontalAlign="Right"></dx:ASPxTextBox>
                            </td>
                            <td style="width:5%">
                                （m³/d）
                            </td>
                        </tr>
                        <tr>
                            <td align="right">中水：
                            </td>
                            <td>
                                <dx:ASPxTextBox runat="server" ID="txtZHONGSHUI" ClientInstanceName="txtZHONGSHUI" type="text" Style="width: 100%;" HorizontalAlign="Right">
                                    <ClientSideEvents KeyUp="function(s,e){inputNum(s);}" />
                                </dx:ASPxTextBox>
                            </td>
                            <td>
                               
                            </td>
                            <td align="right">雨水：
                            </td>
                            <td>
                                <dx:ASPxTextBox runat="server" ID="txtYuShui" ClientInstanceName="txtYuShui" type="text" Style="width: 100%;" HorizontalAlign="Right">
                                    <ClientSideEvents KeyUp="function(s,e){inputNum(s);}" />
                                </dx:ASPxTextBox>
                            </td>
                            <td></td>
                            <td colspan="3">                                
                                <dx:ASPxCheckBox ID="cbJianGuan" runat="server" Text="是否纰漏监管"></dx:ASPxCheckBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">日期：
                            </td>
                            <td>
                                <dx:ASPxDateEdit ID="txtRQ" runat="server" Width="100%">
                                </dx:ASPxDateEdit>
                            </td>
                            <td colspan="7"></td>
                        </tr>
                    </table>
                    <hr />
                    <div style="border: 0px red solid;">
                        <table style="width: 100%;">
                            <tr>
                                <td align="right">

                                    <hr />
                                    <dx:ASPxButton ID="btnSave" runat="server" Text="保存" UseSubmitBehavior="false" OnClick="btnSave_Click">
                                       <ClientSideEvents  Click="function(s,e){
                                           recountValue();
                                           //验证
                                           if(validateValue())
                                           {
                                            e.processOnServer = true;
                                           }
                                           else
                                           {
                                            e.processOnServer = false;
                                           }
                                           }"
                                       />
                                    </dx:ASPxButton>
                                    <dx:ASPxButton ID="btnCancel" runat="server" Text="放弃" UseSubmitBehavior="false" OnClick="btnCancel_Click">
                                       
                                    </dx:ASPxButton>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>

            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>


